package stdying.handyweibo.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import stdying.handyweibo.MainActivity;
import stdying.handyweibo.R;
import stdying.handyweibo.openapi.TokenSession;
import stdying.handyweibo.ui.auth.WBAuthActivity;
import stdying.handyweibo.view.IloginView;
import timber.log.Timber;

/**
 * 欢迎首页
 */
public class WelcomeActivity extends AppCompatActivity implements IloginView{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);

        if(TokenSession.getTokenType(this) == -1){
            Intent intentAuth = new Intent();
            intentAuth.setClass(this, WBAuthActivity.class);
            startActivity(intentAuth);
        }else{
            Timber.i("查询用户信息");
            Intent intent = new Intent(this, MainActivity.class);
            startActivity(intent);
            finish();
        }

    }


    @Override
    public boolean logIn() {
        return false;
    }

    @Override
    public void logOut() {

    }
}
